<?php 
/**
 * 维度表的相关操作
 */
 class dimensions_Info{
    const TABLE_NAME = 'dimensions';
    
    /**
     *单例对象
     */    
   public static $singletonObjects = array();
   
   /**
    * 获取单例对象
    */
   public static function getInstance(){
       $className = __CLASS__;
       if( !isset( self::$singletonObjects[$className] ) )
		{
			self::$singletonObjects[$className] = new self( );
		}

		return self::$singletonObjects[$className];
       
       
   }
   //从维度表中获得消费层次
   public function getDim(){
       $dimInfo = common::getMysql()->getList( self::TABLE_NAME , array( 'FId' =>18 ) );
       return $dimInfo;    
   }
   //从维度表中获得性别
   public function getSex(){
       $sexInfo =  common::getMysql()->getList( self::TABLE_NAME , array( 'FId' =>17 ) );
       return $sexInfo;
   }
   //从维度表中获得年龄段
   public function getAge(){
       $ageInfo =  common::getMysql()->getList( self::TABLE_NAME , array( 'FId' =>19 ) );
       return $ageInfo;
       
   }
   /**
    *根据维度DId 获得维度的值 
    */
     public function getDimensions( $did ){
         $dimensions = Common::getMysql()->get( self::TABLE_NAME , array( 'DId' => $did));
         return $dimensions;
         
     }
     
    
 }

